<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <body>
		<t:formvalid formid="formobj" dialog="true" layout="table" action="buildingRoomController.do?doUpdate" tiptype="3" >
		<input id="id" name="id" type="hidden" value="${room.id }">
	 				 
		<table style="" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
				<td align="right">
						<label class="Validform_label">
							选择校区:
						</label>
					</td>
					<td class="value">
					    <t:CommonSelect url="expFieldSchoolController.do?select" callback="schoolLoded"
					    	value="${room.floor.buildingInfo.schoolArea.id }"
					 			 name="schoolId" textField="schoolName" idField="id"></t:CommonSelect>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">校区名称</label>
					</td>
				</tr>
				 
				<tr>
					<td align="right">
						<label class="Validform_label">
							选择楼号:
						</label>
					</td>
					<td class="value">
					     	<t:CommonSelect url="buildingController.do?select"  
					     	    callback="buildingLoaded" value="${room.floor.buildingInfo.id}"
					 			 name="buildingId" textField="buildingNumber" idField="id"></t:CommonSelect>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">楼号</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							所属楼层:
						</label>
					</td>
					<td class="value">
					     	 
							 <t:CommonSelect url="floorController.do?select"  
					 			 name="floorId" textField="floorNumber" idField="id" value="${room.floor.id }"></t:CommonSelect>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">所属楼层</label>
					</td>
				</tr>
				 
				<tr>
					<td align="right">
						<label class="Validform_label">
							房间号码:
						</label>
					</td>
					<td class="value">
					     	<input id="roomNumber" name="roomNumber" type="text"  	maxlength="5" value="${room.roomNumber }"
					     		style="width: 150px" class="inputxt"  datatype="*">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">房间号码</label>
					</td>
				</tr>
			</table>
		</t:formvalid>
 </body>
  <script>
 	$('#schoolId').change(function(){
 		reloadBuildingSelect();
 	 
 	});
	//校区下拉框加载完毕
	function schoolLoded(){
		reloadBuildingSelect();
	}
	
	//楼号重新加载
 	function buildingLoaded(){
 		reloadFloorSelect();
 	}
 	$('#buildingId').change(function(){
 		reloadFloorSelect();
 	});
 	 

 	 
 		
 	function reloadBuildingSelect(){
 		var schoolId = $('#schoolId').val();
 		//重新刷新建筑id
 		buildingIdselect("&schoolId="+schoolId);
 	}
 	
 	function reloadFloorSelect(){
 		var buildingId = $('#buildingId').val();
 		//重新刷新楼层
 		floorIdselect("&buildId="+buildingId);
 	}
 	 
 	
 </script>